<?php //$this->Html->script('jquery-1.4.2.min');                      ?>
<div class="widget grid12">
    <div class="whead"><h6>FORMULARIO DE EDICION TAGS: <?php //echo $orden['OrdenesTag']['tag_id']; ?></h6><div class="clear"></div></div>
    <?php echo $this->Form->create('OrdenesTag', array('action'=>'editar'), array('id' => "validate")); ?>


  <div class="formRow">
        <div class="grid3"><label>Tag de la Orden:<span class="req">*</span></label></div>
        <div class="grid9">
            <?php echo $this->Form->text('tag_id', array('placeholder' => 'Ingrese el Tag', "class" => "validate[required]")); ?>
            
        </div>
        <div class="clear"></div>
    </div>

    <div class="formRow">
        <div class="grid3"><label>Numero Activo :<span class="req">*</span></label></div>
        <div class="grid9">
            <?php echo $this->Form->text('nactivo', array('placeholder' => 'Ingrese Monto')); ?>
        </div>
        <div class="clear"></div>
    </div>

    <div class="formRow">
        <div class="grid3"><label>Monto:</label></div>
        <div class="grid9">
            <?php echo $this->Form->text('monto', array('placeholder' => 'Ingrese el nactivo')); ?>
        </div>
        <div class="clear"></div>
    </div>     

    <!-- sheepIt Form -->
    <div id="sheepItForm">
        <!-- Form template-->
  
        <!-- /Form template-->                  
        <!-- No forms template -->
        <div id="sheepItForm_noforms_template">Ningun Tags</div>
        <!-- /No forms template-->

        <!-- Controls -->
        <div id="sheepItForm_controls">
            <div id="sheepItForm_add"><a><span>Mas Tags</span></a></div>
            <div id="sheepItForm_remove_last"><a><span>Quitar</span></a></div>
            <div id="sheepItForm_remove_all"><a><span>Quitar Todos</span></a></div>
            <div id="sheepItForm_add_n">
                <input id="sheepItForm_add_n_input" type="text" size="4" />
                <div id="sheepItForm_add_n_button"><a><span>Anadir</span></a></div></div>
        </div>
        <!-- /Controls -->

    </div>
    <!-- /sheepIt Form -->          

    <div class="clear"></div>

</div>
<script>
    $(document).ready(function() {
        
        $( "#fechaPed" ).datepicker({
            defaultDate: +7,
            showOtherMonths:true,
            autoSize: true,
            /*appendText: '(Ano-Mes-Dia)',*/
            dateFormat: 'yy-mm-dd',
            changeMonth: true,
            changeYear: true
        });        
        /* Init the table */
        var oTable = $('.dTable').dataTable( );
        
        /* Add/remove class to a row when clicked on */
        $('.dTable tr').click( function() {
            $(this).toggleClass('row_selected');               
        } );
        
        $('#btEnvia').hover( function() {
            //$(this).toggleClass('row_selected');  
            $.fn.getCheckboxValues = function(){
                var values = [];
                var i = 0;
                this.each(function(){
                    values[i++] = $(this).val();
                });
                return values;
            } 

            var arr = $("input:checked").getCheckboxValues();
            $("#seleccionados").val(arr);
            console.log('es'+arr);
        } );
        
        var sheepItForm = $('#sheepItForm').sheepIt({
            separator: '',
            allowRemoveLast: true,
            allowRemoveCurrent: true,
            allowRemoveAll: true,
            allowAdd: true,
            allowAddN: true,
            maxFormsCount: 150,
            minFormsCount: 1,
            iniFormsCount: 1,
            continuousIndex: true
        });              
            
    } );                 
    
</script>
    <div class="formRow">
        <?php
        $options = array(
            'label' => 'Guardar Datos',
            'class' => 'buttonS bLightBlue',
            'id' => 'btEnvia'
        );
        echo $this->Form->end($options);
        ?> 
        <div class="clear"></div>        
    </div>